# This is a sample Python script.

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
# from torch import nn
# import torch.optim as optim
# import torchvision
# from torchvision import transforms,models,datasets

import cv2

def print_hi(name):
    video_full_path = 'd://5e1c370dd98c2.mp4'
    cap = cv2.VideoCapture(video_full_path)
    print(cap)
    print(cap.isOpened())

    frame_count = 1
    success = True
    while (success):
        success, frame = cap.read()
        # print('Read a new frame: ', success)

        params = []
        # params.append(cv.CV_IMWRITE_PXM_BINARY)
        params.append(1)
        cv2.imwrite("video" + "_%d.jpg" % frame_count, frame, params)
        frame_count = frame_count + 1

    cap.release()

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    print_hi('PyCharm')

# See PyCharm help at https://www.jetbrains.com/help/pycharm/
